package ae.pcfc.etks.online.itworx.ehs.web.enums;

import java.util.HashMap;
import java.util.Map;

public enum RequestField {

	RequestId("id"), ProcessId("processId"), UserId("userId"), OfficerId(
			"officerId"), Status("status"), CreationDate("creationDate"), ProcessingDate(
			"processingDate"), Type("type"),CompanyNameEn("companyNameEnglish"),Service("service"),
			Name("name"),
			NameArab("nameArab"), TrakheesId("trakheesId");

	private static Map<String, RequestField> propertyMap = new HashMap<String, RequestField>();

	static {
		propertyMap.put(RequestId.getPropertyName(), RequestId);
		propertyMap.put(ProcessId.getPropertyName(), ProcessId);
		propertyMap.put(UserId.getPropertyName(), UserId);
		propertyMap.put(OfficerId.getPropertyName(), OfficerId);
		propertyMap.put(Status.getPropertyName(), Status);
		propertyMap.put(CreationDate.getPropertyName(), CreationDate);
		propertyMap.put(ProcessingDate.getPropertyName(), ProcessingDate);
		propertyMap.put(Type.getPropertyName(), Type);
		propertyMap.put(CompanyNameEn.getPropertyName(), CompanyNameEn);
		propertyMap.put(Service.getPropertyName(), Service);
		propertyMap.put(Name.getPropertyName(), Name);
		propertyMap.put(NameArab.getPropertyName(), NameArab);
		propertyMap.put(TrakheesId.getPropertyName(), TrakheesId);
	}

	private String propertyName;

	RequestField(String propertyName) {
		this.propertyName = propertyName;
	}

	public String getPropertyName() {
		return propertyName;
	}

	public static RequestField getFromPropertyName(String propertyName) {
		if (propertyMap.containsKey(propertyName)) {
			return propertyMap.get(propertyName);
		} else {
			return null;
		}
	}
}
